package per.ethan.cloud.provider.service.impl;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import per.ethan.cloud.common.mapper.BaseMapper;
import per.ethan.cloud.common.service.impl.BaseServiceImpl;
import per.ethan.cloud.provider.entity.Balance;
import per.ethan.cloud.provider.mapper.BalanceMapper;
import per.ethan.cloud.provider.service.BalanceService;

import java.util.concurrent.TimeUnit;

/**
* @author Ethan
* @date 2020/04/13 01:41
*/
@Slf4j
@Service("balanceService")
@RequiredArgsConstructor(onConstructor_ = @Autowired)
public class BalanceServiceImpl extends BaseServiceImpl<Balance> implements BalanceService {

    @Qualifier("balanceMapper")
    private final BalanceMapper balanceMapper;

    @Override
    public BaseMapper<Balance> getBaseMapper() {
        return balanceMapper;
    }

    @Override
    public boolean update(Balance entity) {
        try {
            TimeUnit.SECONDS.sleep(20);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return super.update(entity);
    }
}
